The invention is related to a method for encoding a size of a data section and to an encoder for encoding a size of a data section. The invention is further related to a method for determining a size of a data section and to a decoder for determining a size of a data section.
An encoded size may indicate the length of a subsequent signal value section of variable length, the extent of a subsequent filename or an amount of subsequent information units used for encoding other data. That is, an encoded size may be used as a prefix in a variable length encoding scheme.
In variable length coding, varying numbers of information units are used for encoding pay load data. The information units used for some pay load data form a data section of variable extent. The extent of the data section corresponds to the length of the code representing the pay load data. To allow decoding of an encoded integer signal value, the extent of the data section is encoded as a size in a prefix. Thus, the size represents the number of information units used for coding the integer signal value.
The prefix itself may be formed from a variable number of information units and thus may have variable length. If so, this requires at least a preceding portion of the prefix being encoded independently. That is, the preceding portion can be decoded without further information.
To meet this requirement the preceding portion commonly comprises unary code, i.e. a number of information units of equal content. This number indicates the size of the remaining part of the prefix.
As the size of the remaining part is at least 1, the number of information units of equal content can be by one smaller than the size of the remaining part. So the size of the preceding portion is by 1 smaller than the size of the remaining part.
The remaining part of the prefix then comprises the binary encoded size.
Variable length coding allows for efficient use of storage space and transmission bandwidth. Therefore, it is used in a variety of technical applications. For instance, variable length coding is used for encoding visual sensor inputs, for transmission of video or multimedia streams or for storage of audio data, just to name a few.
The advantages of variable length coding come along with the overhead of requiring prefixes. Especially the preceding portion is bulky due to the requirement of independent encoding. Thus, there is a need for further reducing the average size of the preceding portion.